package com.nlx.notes.module.service.gold;

import com.baomidou.mybatisplus.extension.service.IService;
import com.nlx.notes.module.bean.dto.gold.GoldPurchaseAddDTO;
import com.nlx.notes.module.bean.dto.gold.GoldPurchasePageDTO;
import com.nlx.notes.module.bean.dto.gold.GoldPurchaseSelectListDTO;
import com.nlx.notes.module.bean.vo.PageResultVo;
import com.nlx.notes.module.bean.vo.gold.GoldPurchaseBaseInfoVO;
import com.nlx.notes.module.bean.vo.gold.GoldPurchasePageVO;
import com.nlx.notes.module.entity.GoldPurchaseEntity;

import java.math.BigDecimal;
import java.util.List;

public interface IGoldPurchaseService extends IService<GoldPurchaseEntity> {

    long countByCondition(GoldPurchasePageDTO goldPurchasePageDTO);

    List<GoldPurchaseEntity> pageByCondition(GoldPurchasePageDTO goldPurchasePageDTO);

    /**
     * 通过条件查询列表
     * @param goldPurchaseSelectListDTO 参数
     * @return GoldPurchaseEntity
     */
    List<GoldPurchaseEntity> selectListByCondition(GoldPurchaseSelectListDTO goldPurchaseSelectListDTO);

    /**
     * 通过用户id查询黄金详情
     * @param goldId 黄金id
     * @param userId 用户id
     * @return GoldPurchaseEntity
     */
    GoldPurchaseEntity findById(Long goldId, Long userId);

    /**
     * 计算用户的黄金总总量
     * @param userId 用户id
     * @return BigDecimal
     */
    BigDecimal sumWeightByUser(Long userId);

    /**
     * 计算用户的黄金购买总额
     * @param userId 用户id
     * @return BigDecimal
     */
    BigDecimal sumTotalPriceByUser(Long userId);

    /**
     * 删除黄金购买数据
     * @param goldId 黄金id
     * @param userId 用户id
     */
    boolean removeGold(Long goldId, Long userId);
}
